package xcmg.device.web.sale;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import xcmg.device.infra.BasicController;
import xcmg.device.infra.ErrorCode;
import xcmg.device.service.sale.SalesBillDetailService;
import xcmg.device.service.vo.sale.SalesBillDetailVO;
import yb.ecp.fast.infra.annotation.FastMappingInfo;
import yb.ecp.fast.infra.infra.ActionResult;

/**
 * Created by wrg on 2019/4/22.
 */
@RestController
@RequestMapping("/salesBillDetails")
@Api("销售单详情入口")
public class SalesBillDetailsController extends BasicController {
@Autowired
    private SalesBillDetailService salesBillDetailService;
    @PostMapping(value = "/list")
    @ApiOperation("获取销售单详情信息列表")
    @FastMappingInfo(needLogin = true)
    public ActionResult list(@RequestBody SalesBillDetailVO condition) throws Exception {

        if (null == condition || StringUtils.isBlank(condition.getSalesBillNo())) {
           return actionResult(ErrorCode.IllegalArument);
        }
        return actionValueResult(salesBillDetailService.list(condition));
    }
}
